package com.ruoyi.web.controller.tzzl;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.tzzl.domain.WzMessageLogging;
import com.ruoyi.tzzl.service.IWzMessageLoggingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 *  消息通知记录
 * @author by caoyong
 * @date 2022/12/10
 **/
@RestController
@RequestMapping("/tzzl/logging")
public class WzMessageLoggingController extends BaseController {

    @Autowired
    private IWzMessageLoggingService wzMessageLoggingService;



    /**刷新用户消息状态*/
    @PostMapping("/addMessageRecord")
    public AjaxResult addMessageRecord(@RequestBody WzMessageLogging wzMessageLogging){
        return AjaxResult.success(wzMessageLoggingService.addMessageRecord(wzMessageLogging));
    }

    /**
     *查看用户消息记录
     * */
    @GetMapping("/getMessageRecord")
    public AjaxResult getMessageRecord(Long id){
        return AjaxResult.success(wzMessageLoggingService.getMessageRecord(id));
    }

    /**查看用户新消息数量*/
    @GetMapping("/newMessage")
    public AjaxResult newMessage(Long id){
        return AjaxResult.success(wzMessageLoggingService.newMessage(id));
    }


}

